""":arg

在数据浏览中搜索
查看某个采集是否有某个类型的数据
"""

import time

import requests

Headers = {
    'Cookie':'DataAcquisition-sid=s%3A81pFBwdSda4v7ll5753239K6UcxTTVsC.cxlaGsKFM1TgOpLBc%2FEgBHpvaVS04Ksu7CMihoZT6wk'
}

# 获取采集id
collect_id_url = "http://172.16.60.12/bcp/list?limit=20&offset=0"


collect_id_response = requests.get(url = collect_id_url, headers=Headers)

count = collect_id_response.json()['count']


pagenum = 0
x = 0
circle_num = 0
offset_count = 0
for i in range(1, count+1):

    if i % 20 == 0:
        x = 0
        offset_count  += 1
        collect_id_url = "http://172.16.60.12/bcp/list?limit=20&offset={}".format(offset_count*20)
        collect_id_response = requests.get(url=collect_id_url, headers=Headers)
        print(collect_id_url)
    id = collect_id_response.json()['collects'][x]['_id']
    # 数据浏览中的商品信息表
    data_scan_url = "http://172.16.60.12/collect/{}/bcpInfoDetail?collectId={}&offset=0&limit=20&index=ecomgoods".format(
        id, id)
    data_response = requests.get(url=data_scan_url, headers=Headers)
    if data_response.json()['total'] != 0:
        print("有数据的"+id)
    x += 1
# 数据浏览









